package com.power.sifa.supervise.model;

import com.plf.core.base.model.Ha_attachment;
import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import javax.persistence.Transient;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
*  处理反馈材料实体类
*/

@Entity
@ApiModel(value="处理反馈材料")
@Data
@Table(name="Apl_feedbackdoc",schema="sfapprove")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Builder
@AllArgsConstructor
//@IdClass(Apl_feedbackdoc.Apl_feedbackdocPK.class) 用于复合组件
public class Apl_feedbackdoc extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    @ApiModelProperty(value = "applyid + nanoid")
    private String id;

    @ApiModelProperty(value = "applyid")
    private String applyid;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "说明")
    private String explain;

    @ApiModelProperty(value = "附件id")
    private String attachids;

    @ApiModelProperty(value = "创建时间")
    private String createtime;

    @ApiModelProperty(value = "创建人id")
    private String createuserid;

    @ApiModelProperty(value = "创建人name")
    private String createusername;

    /**
     * 附件详情信息
     */
    @Transient
    private List<Ha_attachment> attachmentList;

    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("applyid", this.getApplyid());
        map.put("name", this.getName());
        map.put("explain", this.getExplain());
        map.put("attachids", this.getAttachids());
        map.put("createtime", this.getCreatetime());
        map.put("createuserid", this.getCreateuserid());
        map.put("createusername", this.getCreateusername());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Apl_feedbackdocPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Apl_feedbackdocPK pk = (Apl_feedbackdocPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
